/* 播放器样式 - 精简版 */
body {
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.8);
    /* 半透明黑色背景 */
    backdrop-filter: blur(20px);
    /* 背景模糊效果 */
    -webkit-backdrop-filter: blur(20px);
    /* Safari支持 */
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    color: #ffffff;
    overflow: hidden;
    border-radius: 12px;
    /* WIN11风格圆角 */
}

/* 全局按钮重置 - 移除所有默认样式 */
button {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* 播放器内的按钮特殊重置 */
.player-container button,
.playback-controls button,
.player-overlay button {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* 自定义标题栏样式 */
.custom-titlebar {
    height: 30px;
    background: rgba(45, 45, 45, 0.8);
    /* 半透明背景 */
    backdrop-filter: blur(15px);
    /* 背景模糊效果 */
    -webkit-backdrop-filter: blur(15px);
    /* Safari支持 */
    border-bottom: 1px solid rgba(64, 64, 64, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    -webkit-app-region: no-drag;
    user-select: none;
    z-index: 1000;
    border-radius: 12px 12px 0 0;
    /* 顶部圆角 */
}

.titlebar-drag-region {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 15px;
    -webkit-app-region: drag;
}

.titlebar-title {
    font-size: 13px;
    color: #ffffff;
    font-weight: 400;
}

.titlebar-controls {
    display: flex;
    -webkit-app-region: no-drag;
}

.titlebar-button {
    width: 46px;
    height: 30px;
    border: none;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.titlebar-button:hover {
    background: #404040;
}

.titlebar-button.close-btn:hover {
    background: #e81123;
}

.titlebar-button svg {
    opacity: 0.8;
}

.titlebar-button:hover svg {
    opacity: 1;
}

#player-app {
    position: relative;
    height: calc(100vh - 30px);
    /* 减去标题栏高度 */
    display: flex;
    flex-direction: column;
}

/* 播放器容器 - 全屏布局 */
.player-container {
    flex: 1;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    /* 允许显示绝对定位的子元素 */
}

#video-player {
    width: 100%;
    height: 100%;
    outline: none;
    overflow: hidden;
    /* 防止视频内容溢出 */
    object-fit: contain;
    /* 保持长宽比，完整显示视频内容 */
    background: #000;
    max-width: 100%;
    max-height: 100%;
    /* 确保视频元素可以接收点击事件 */
    pointer-events: auto !important;
    cursor: pointer;
    /* 防止用户选择文本干扰点击 */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 隐藏原生视频控制栏 - 强制隐藏所有可能的控制元素 */
#video-player::-webkit-media-controls {
    display: none !important;
    -webkit-appearance: none !important;
}

#video-player::-webkit-media-controls-panel {
    display: none !important;
    -webkit-appearance: none !important;
}

#video-player::-webkit-media-controls-play-button {
    display: none !important;
    -webkit-appearance: none !important;
}

#video-player::-webkit-media-controls-start-playback-button {
    display: none !important;
    -webkit-appearance: none !important;
}

/* 隐藏所有可能的原生控件 */
video {
    outline: none !important;
}

video::-webkit-media-controls,
video::-webkit-media-controls-panel,
video::-webkit-media-controls-play-button,
video::-webkit-media-controls-start-playback-button,
video::-webkit-media-controls-timeline,
video::-webkit-media-controls-current-time-display,
video::-webkit-media-controls-time-remaining-display,
video::-webkit-media-controls-mute-button,
video::-webkit-media-controls-volume-slider,
video::-webkit-media-controls-fullscreen-button,
video::-webkit-media-controls-seek-back-button,
video::-webkit-media-controls-seek-forward-button,
video::-webkit-media-controls-return-to-realtime-button,
video::-webkit-media-controls-rewind-button,
video::-webkit-media-controls-toggle-closed-captions-button {
    display: none !important;
    -webkit-appearance: none !important;
}

/* 彻底隐藏所有可能的顶部控制元素 - 最终方案 */
.overlay-header,
#overlay-header,
[class*="header"],
[class*="top-control"],
[id*="top-control"],
[class*="overlay-control"],
video::-webkit-media-controls-overlay-enclosure,

/* 错误提示样式 */
#player-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    max-width: 90%;
    width: 400px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

#player-error h3 {
    color: #ff4444;
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 500;
}

#error-message {
    color: #cccccc;
    font-size: 14px;
    margin-bottom: 25px;
    line-height: 1.5;
}

#error-suggestions {
    text-align: left;
    margin-bottom: 25px;
    padding: 0;
}

#error-suggestions li {
    color: #999999;
    font-size: 13px;
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    list-style: none;
}

#error-suggestions li:before {
    content: "•";
    color: #666666;
    position: absolute;
    left: 0;
}

#retry-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2) !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3) !important;
    font-weight: 500;
}

#retry-btn:hover {
    background: linear-gradient(135deg, #1976D2, #1565C0) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.4) !important;
}

#retry-btn:active {
    transform: translateY(0) !important;
}

/* 顶部错误通知条样式 */
.error-notification {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 68, 68, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(255, 68, 68, 0.3);
    z-index: 2000;
    animation: slideDown 0.3s ease-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 错误状态时的控制栏样式 */
.error-state .playback-controls {
    opacity: 0.6;
    pointer-events: none;
}

video::-webkit-media-controls-overlay-play-button,
video::-webkit-media-controls-enclosure,
.video-js .vjs-control-bar,
.plyr__controls,
.dplayer-controller,
.jwplayer-controlbar,
.video-react-control-bar,
.fp-controls,
iframe[src*="player"]::-webkit-media-controls {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

#video-player::-webkit-media-controls-timeline {
    display: none !important;
    -webkit-appearance: none !important;
}

#video-player::-webkit-media-controls-current-time-display {
    display: none !important;
    -webkit-appearance: none !important;
}

#video-player::-webkit-media-controls-time-remaining-display {
    display: none !important;
    -webkit-appearance: none !important;
}

#video-player::-webkit-media-controls-mute-button {
    display: none !important;
    -webkit-appearance: none !important;
}

#video-player::-webkit-media-controls-volume-slider {
    display: none !important;
    -webkit-appearance: none !important;
}

#video-player::-webkit-media-controls-fullscreen-button {
    display: none !important;
    -webkit-appearance: none !important;
}

/* 隐藏所有可能的视频控件 */
#video-player::-webkit-media-controls-enclosure {
    display: none !important;
}

#video-player::-webkit-media-controls-overlay-enclosure {
    display: none !important;
}

/* 对于Firefox */
#video-player::-moz-media-controls {
    display: none !important;
}

/* 通用隐藏 */
video::-internal-media-controls {
    display: none !important;
}

video::-webkit-media-controls {
    display: none !important;
}

/* 悬浮控制栏 */
.player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, transparent 30%, transparent 70%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 100;
    opacity: 0;
    transition: all 0.3s ease;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: auto;
}

/* 移除自动hover显示，只通过JS控制 */
.player-overlay:hover,
.player-overlay.show {
    opacity: 1;
}

/* 右上角控制按钮区域 - 正常显示/隐藏逻辑 */
.top-right-controls {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    display: flex !important;
    gap: 8px !important;
    z-index: 999999 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

.btn-top-control {
    width: 80px !important;
    height: 40px !important;
    background: yellow !important;
    border: 2px solid red !important;
    border-radius: 6px !important;
    color: black !important;
    font-size: 12px !important;
    cursor: pointer !important;
    display: block !important;
    margin: 2px !important;
    padding: 5px !important;
}

.btn-top-control:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.05) !important;
    border: none !important;
    box-shadow: none !important;
}

/* 当播放器悬浮层显示时，显示右上角控制按钮 - 最高优先级 */
.player-container .player-overlay.show .top-right-controls,
.player-overlay.show .top-right-controls,
body .player-container .player-overlay.show .top-right-controls {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.overlay-header {
    display: none !important;
    /* 窗口模式下隐藏顶部控制栏 */
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    justify-content: space-between;
    align-items: center;
}

.overlay-header * {
    display: none !important;
    visibility: hidden !important;
}

.video-info h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.video-info span {
    font-size: 14px;
    color: #ccc;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.overlay-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 按钮样式优化 */
.btn-control,
.btn-close,
.btn-retry {
    padding: 10px 14px;
    /* 增大padding，让按钮更大一些 */
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-control:hover:not(:disabled) {
    background: rgba(0, 120, 212, 0.8);
    border-color: rgba(0, 120, 212, 0.5);
    transform: translateY(-1px);
}

.btn-control:disabled {
    background: rgba(102, 102, 102, 0.5);
    cursor: not-allowed;
    opacity: 0.5;
}

/* 置顶按钮激活状态 */
.btn-control.active {
    background: rgba(255, 193, 7, 0.8);
    border-color: rgba(255, 193, 7, 0.5);
    color: #000;
}

.btn-control.active:hover {
    background: rgba(255, 193, 7, 0.9);
    border-color: rgba(255, 193, 7, 0.7);
}

/* 投屏按钮样式 */
#cast-video {
    position: relative;
}

#cast-video:hover {
    background: rgba(138, 43, 226, 0.8) !important;
    border-color: rgba(138, 43, 226, 0.5) !important;
}

#cast-video.casting {
    background: rgba(40, 167, 69, 0.8) !important;
    border-color: rgba(40, 167, 69, 0.5) !important;
    animation: pulse 2s infinite;
}

/* 分享按钮样式 */
#share-video {
    position: relative;
}

#share-video:hover {
    background: rgba(74, 144, 226, 0.8) !important;
    border-color: rgba(74, 144, 226, 0.5) !important;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

.btn-close {
    background: rgba(220, 53, 69, 0.8);
}

.btn-close:hover {
    background: rgba(200, 35, 51, 0.9);
    transform: translateY(-1px);
}

.btn-retry {
    background: rgba(40, 167, 69, 0.8);
}

.btn-retry:hover {
    background: rgba(33, 136, 56, 0.9);
}

/* 图标样式 */
.icon {
    font-size: 16px;
    /* 从12px调整到16px，增大图标 */
    display: inline-block;
}

/* 可收纳的选集面板 - 简化版本 */
.episode-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border-top: 1px solid #333;
    z-index: 200;
    display: none;
    max-height: 70vh;
    /* 限制最大高度为视口高度的70% */
    /* 点击外部区域自动关闭需要添加事件监听 */
}

.new-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.new-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.new-close-btn:active {
    transform: scale(0.95);
}

.close-icon {
    line-height: 1;
    display: inline-block;
}

.episode-panel.show {
    display: flex;
    flex-direction: column;
}

/* 选集面板顶部标题样式 */
.episode-panel-header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(64, 64, 64, 0.5);
    z-index: 10;
}

.episode-panel-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}









.episode-list {
    flex: 1;
    padding: 15px 20px 20px;
    overflow-y: auto;
}

/* 线路选择区域 */
.route-selection {
    padding: 10px 20px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.route-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.route-tab {
    background: rgba(51, 51, 51, 0.8);
    border: 1px solid rgba(85, 85, 85, 0.8);
    border-radius: 20px;
    color: #cccccc;
    cursor: pointer;
    font-size: 12px;
    padding: 8px 16px;
    transition: all 0.3s ease;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.route-tab:hover {
    background: rgba(0, 120, 212, 0.6);
    border-color: rgba(0, 120, 212, 0.4);
    color: #ffffff;
    transform: translateY(-1px);
}

.route-tab.active {
    background: rgba(0, 120, 212, 0.9);
    border-color: rgba(0, 120, 212, 0.7);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(0, 120, 212, 0.3);
}

.episodes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    padding: 15px 20px 20px;
    overflow-y: auto;
    flex: 1;
    /* 占满剩余空间 */
    max-height: 100%;
    box-sizing: border-box;
}

.episode-item {
    padding: 10px 15px;
    background: rgba(51, 51, 51, 0.8);
    border: 1px solid rgba(85, 85, 85, 0.8);
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    text-align: center;
    backdrop-filter: blur(10px);
}

.episode-item:hover {
    background: rgba(0, 120, 212, 0.8);
    border-color: rgba(0, 120, 212, 0.6);
    transform: translateY(-2px);
}

.episode-item.current {
    background: rgba(0, 120, 212, 0.9);
    border-color: rgba(0, 120, 212, 0.7);
    box-shadow: 0 0 10px rgba(0, 120, 212, 0.3);
}

.episode-item.watched {
    background: rgba(40, 167, 69, 0.8);
    border-color: rgba(40, 167, 69, 0.6);
}

/* 加载状态 */
.player-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 150;
    background: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #0078d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.player-loading p {
    font-size: 16px;
    color: #ccc;
    margin: 0;
}

/* 错误状态 */
.player-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 150;
    background: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.player-error p {
    font-size: 18px;
    color: #dc3545;
    margin: 0 0 20px 0;
}

/* 滚动条样式 */
.episode-list::-webkit-scrollbar {
    width: 8px;
}

.episode-list::-webkit-scrollbar-track {
    background: rgba(26, 26, 26, 0.5);
    border-radius: 4px;
}

.episode-list::-webkit-scrollbar-thumb {
    background: rgba(85, 85, 85, 0.8);
    border-radius: 4px;
}

.episode-list::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 102, 102, 0.9);
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .player-overlay {
        padding: 15px;
    }

    .video-info h3 {
        font-size: 16px;
    }

    .video-info span {
        font-size: 12px;
    }

    .overlay-controls {
        gap: 8px;
    }

    .btn-control,
    .btn-close {
        padding: 6px 10px;
        font-size: 12px;
    }

    .new-close-btn {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }

    .episode-list {
        padding: 12px 15px 15px;
    }

    .episodes {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
        padding: 12px 15px 15px;
    }

    .episode-item {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* 网页播放器样式 */
#webpage-player-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

#webpage-player-container .toolbar {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#webpage-player-container .toolbar button {
    padding: 4px 8px;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

#webpage-player-container .toolbar button:hover {
    opacity: 0.8;
}

#webpage-player-container iframe {
    width: 100%;
    flex: 1;
    border: none;
    background: #000;
}

/* 视频播放器增强样式 - 确保各种分辨率的视频都能正确显示 */
#video-player {
    /* 基础显示属性 */
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;

    /* 保持长宽比并完整显示内容 */
    object-fit: contain !important;
    object-position: center !important;

    /* 基础样式 */
    outline: none;
    background: #000;

    /* 禁用默认的视频控制行为，确保自适应正常工作 */
    display: block;
}

/* 确保播放器容器能够正确处理各种视频尺寸 */
.player-container {
    flex: 1;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* 防止视频溢出 */
    width: 100%;
    height: 100%;
}

/* 针对超宽屏或超高屏的特殊处理 */
@media (aspect-ratio > 21/9) {

    /* 超宽屏幕 */
    .player-container {
        align-items: center;
        padding: 0 5%;
    }
}

@media (aspect-ratio < 4/3) {

    /* 超高屏幕 */
    .player-container {
        justify-content: center;
        padding: 5% 0;
    }
}

/* 确保在全屏模式下视频也能正确显示 */
#video-player:fullscreen {
    object-fit: contain !important;
    width: 100vw !important;
    height: 100vh !important;
}

#video-player:-webkit-full-screen {
    object-fit: contain !important;
    width: 100vw !important;
    height: 100vh !important;
}

#video-player:-moz-full-screen {
    object-fit: contain !important;
    width: 100vw !important;
    height: 100vh !important;
}

/* 全屏状态下的浮动控制栏样式 */
.player-container:fullscreen .player-overlay,
.player-container:-webkit-full-screen .player-overlay,
.player-container:-moz-full-screen .player-overlay,
body.fullscreen-mode .player-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    width: 100vw !important;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%) !important;
    padding: 30px !important;
    transform: translateY(-100%) !important;
    transition: all 0.3s ease !important;
    opacity: 0 !important;
}

/* 全屏状态下控制栏的显示状态 */
.player-container:fullscreen .player-overlay.show,
.player-container:-webkit-full-screen .player-overlay.show,
.player-container:-moz-full-screen .player-overlay.show,
body.fullscreen-mode .player-overlay.show,
.player-container:fullscreen .player-overlay:hover,
.player-container:-webkit-full-screen .player-overlay:hover,
.player-container:-moz-full-screen .player-overlay:hover,
body.fullscreen-mode .player-overlay:hover {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* 确保全屏状态下控制栏内的按钮都能显示 */
body.fullscreen-mode .player-overlay .overlay-header,
.player-container:fullscreen .player-overlay .overlay-header,
.player-container:-webkit-full-screen .player-overlay .overlay-header,
.player-container:-moz-full-screen .player-overlay .overlay-header {
    display: flex !important;
    /* 全屏模式下显示顶部控制栏 */
}

body.fullscreen-mode .player-overlay .overlay-controls,
body.fullscreen-mode .player-overlay .overlay-controls .btn-control,
.player-container:fullscreen .player-overlay .overlay-controls,
.player-container:fullscreen .player-overlay .overlay-controls .btn-control,
.player-container:-webkit-full-screen .player-overlay .overlay-controls,
.player-container:-webkit-full-screen .player-overlay .overlay-controls .btn-control,
.player-container:-moz-full-screen .player-overlay .overlay-controls,
.player-container:-moz-full-screen .player-overlay .overlay-controls .btn-control {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 确保全屏状态下右上角按钮显示 */
body.fullscreen-mode .top-right-controls,
.player-container:fullscreen .top-right-controls,
.player-container:-webkit-full-screen .top-right-controls,
.player-container:-moz-full-screen .top-right-controls {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1001 !important;
}

/* 确保全屏状态下选集面板显示 */
body.fullscreen-mode .episode-panel,
.player-container:fullscreen .episode-panel,
.player-container:-webkit-full-screen .episode-panel,
.player-container:-moz-full-screen .episode-panel {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1002 !important;
}

/* 确保按钮图标在全屏状态下可见 */
body.fullscreen-mode .player-overlay .btn-control .icon,
.player-container:fullscreen .player-overlay .btn-control .icon,
.player-container:-webkit-full-screen .player-overlay .btn-control .icon,
.player-container:-moz-full-screen .player-overlay .btn-control .icon {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 播放器容器的鼠标控制 */
.player-container {
    cursor: default !important;
    transition: cursor 0.3s ease;
    pointer-events: auto;
}

/* 鼠标不活动时隐藏光标（窗口模式和全屏模式统一） */
body:not(.mouse-active) .player-container {
    cursor: none !important;
}

/* 修复：确保视频元素始终可接收鼠标事件 */
.player-container video {
    cursor: inherit !important;
    pointer-events: auto !important;
}

/* 鼠标活动时显示光标 */
body.mouse-active .player-container {
    cursor: default !important;
}

body.mouse-active .player-container * {
    cursor: inherit !important;
    pointer-events: auto !important;
}

/* 全屏模式下的body样式 */
body.fullscreen-mode {
    cursor: default !important;
    transition: cursor 0.3s ease;
    pointer-events: auto;
}

body.fullscreen-mode * {
    cursor: inherit !important;
    pointer-events: auto;
}

/* 全屏模式下鼠标移动时显示指针 */
body.fullscreen-mode.mouse-active {
    cursor: default !important;
}

body.fullscreen-mode.mouse-active * {
    cursor: inherit !important;
}

/* 全屏模式下鼠标悬停时显示指针 */
body.fullscreen-mode .player-overlay,
body.fullscreen-mode .player-overlay * {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* 确保视频区域始终可以接收鼠标事件 */
#webpage-player-container,
#webpage-player-container * {
    cursor: inherit !important;
    pointer-events: auto !important;
}

/* 全屏状态下的弹幕输入容器 */
.player-container:fullscreen .danmaku-input-container,
.player-container:-webkit-full-screen .danmaku-input-container,
.player-container:-moz-full-screen .danmaku-input-container,
body.fullscreen-mode .danmaku-input-container {
    position: fixed !important;
    bottom: 100px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 9999 !important;
    width: auto !important;
    max-width: 600px !important;
    min-width: 500px !important;
}

/* 确保弹幕面板在全屏下的隐藏状态正确 */
body.fullscreen-mode .danmaku-input-container.hidden {
    display: none !important;
}

/* 全屏状态下的选集面板 */
.player-container:fullscreen .episode-panel,
.player-container:-webkit-full-screen .episode-panel,
.player-container:-moz-full-screen .episode-panel,
body.fullscreen-mode .episode-panel {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 99999 !important;
    width: 350px !important;
    background: rgba(30, 30, 30, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    display: flex;
    flex-direction: column;
    /* 移除标题区域，直接显示选集列表 */
}

/* 全屏状态下显示的选集面板 */
.player-container:fullscreen .episode-panel.show,
.player-container:-webkit-full-screen .episode-panel.show,
.player-container:-moz-full-screen .episode-panel.show,
body.fullscreen-mode .episode-panel.show {
    transform: translateX(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* 全屏模式下的弹幕容器适配 */
.player-container:fullscreen .danmaku-container,
.player-container:-webkit-full-screen .danmaku-container,
.player-container:-moz-full-screen .danmaku-container,
body.fullscreen-mode .danmaku-container {
    position: fixed !important;
    top: 80px !important;
    /* 为控制栏留出空间 */
    left: 0 !important;
    right: 0 !important;
    bottom: 120px !important;
    /* 为弹幕输入框和底部控制栏留出空间 */
    z-index: 100 !important;
    width: 100vw !important;
    height: calc(100vh - 200px) !important;
}

/* 全屏模式下的投屏对话框适配 */
.player-container:fullscreen .cast-device-modal,
.player-container:-webkit-full-screen .cast-device-modal,
.player-container:-moz-full-screen .cast-device-modal,
body.fullscreen-mode .cast-device-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 10000 !important;
    width: 100vw !important;
    height: 100vh !important;
}

/* 全屏模式下的加载状态适配 */
body.fullscreen-mode .player-loading,
.player-container:fullscreen .player-loading,
.player-container:-webkit-full-screen .player-loading,
.player-container:-moz-full-screen .player-loading {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
    background: rgba(0, 0, 0, 0.8) !important;
}

/* 全屏模式下的错误状态适配 */
body.fullscreen-mode .player-error,
.player-container:fullscreen .player-error,
.player-container:-webkit-full-screen .player-error,
.player-container:-moz-full-screen .player-error {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 9999 !important;
    background: rgba(0, 0, 0, 0.9) !important;
    padding: 30px !important;
    border-radius: 12px !important;
}

/* =================== 弹幕系统样式 =================== */

/* 弹幕容器 */
.danmaku-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 99;
    overflow: hidden;
}

/* 弹幕项 */
.danmaku-item {
    position: absolute;
    white-space: nowrap;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    user-select: none;
    line-height: 1.2;
    padding: 2px 4px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(2px);
}

/* 弹幕动画 */
@keyframes danmaku-move {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(calc(-100vw - 200px));
    }
}

/* 弹幕输入容器 */
.danmaku-input-container {
    position: absolute;
    bottom: 120px;
    /* 在播放进度条上方留出适当间距 */
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: block;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 10px;
    padding: 20px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    min-width: 480px;
    /* 增加最小宽度确保内容不被挤压 */
    max-width: 85%;
    /* 确保在不同分辨率下都有合适的位置 */
    width: 480px;
    /* 固定宽度确保元素排版稳定 */
    box-sizing: border-box;
}

/* 隐藏状态的弹幕面板 */
.danmaku-input-container.hidden {
    display: none !important;
}

.danmaku-input-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

/* 弹幕面板头部 */
.danmaku-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.danmaku-panel-header span {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
}

.btn-close-panel {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.btn-close-panel:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 弹幕设置区域 */
.danmaku-settings {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 5px;
}

.danmaku-toggle-group {
    display: flex;
    align-items: center;
}

.danmaku-toggle-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #ffffff;
    font-size: 14px;
}

.danmaku-toggle-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #00aaff;
}

.danmaku-type-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.danmaku-type-group label {
    color: #ffffff;
    font-size: 14px;
    min-width: 80px;
}

#danmaku-type {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

#danmaku-type:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #00aaff;
}

#danmaku-type option {
    background: rgba(30, 30, 30, 0.95);
    color: #ffffff;
}

/* 弹幕输入框 */
#danmaku-input {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 100%;
    box-sizing: border-box;
}

#danmaku-input::placeholder {
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
}

#danmaku-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #00aaff;
    box-shadow: 0 0 0 2px rgba(0, 170, 255, 0.3);
}

/* 弹幕控制区域 */
.danmaku-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

#danmaku-color,
#danmaku-size {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 12px;
    outline: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    flex-shrink: 0;
}

#danmaku-color:hover,
#danmaku-size:hover {
    background: rgba(255, 255, 255, 0.15);
}

#danmaku-color option,
#danmaku-size option {
    background: #333;
    color: #fff;
}

/* 发送按钮 */
.btn-send {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #00aaff, #0088cc);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.btn-send:hover {
    background: linear-gradient(135deg, #0099ee, #0077bb);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 170, 255, 0.3);
}

.btn-send:active {
    transform: translateY(0);
}

/* 弹幕开关按钮特殊样式 */
#toggle-danmaku.active {
    background: linear-gradient(135deg, #00aaff, #0088cc);
    border-color: #00aaff;
}

#toggle-danmaku.disabled {
    background: rgba(255, 0, 0, 0.7);
    border-color: #ff0000;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .danmaku-input-container {
        min-width: 320px;
        padding: 15px;
        bottom: 100px;
    }

    #danmaku-input {
        font-size: 14px;
        padding: 10px 12px;
    }

    .danmaku-controls {
        gap: 8px;
    }

    #danmaku-color,
    #danmaku-size {
        font-size: 11px;
        padding: 5px 6px;
    }

    .btn-send {
        font-size: 13px;
        padding: 7px 12px;
    }
}

/* =================== 投屏设备选择对话框样式 =================== */

/* 投屏设备选择模态框 */
.cast-device-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.cast-device-modal.show {
    display: flex;
}

/* 模态框背景 */
.cast-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* 模态框内容 */
.cast-modal-content {
    position: relative;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 500px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 模态框头部 */
.cast-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cast-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: #ffffff;
}

.cast-modal-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 16px;
}

.cast-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* 模态框主体 */
.cast-modal-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    min-height: 200px;
}

/* 搜索设备状态 */
.cast-scanning {
    text-align: center;
    padding: 40px 20px;
}

.cast-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #00aaff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.cast-scanning p {
    color: #ccc;
    font-size: 16px;
    margin: 0;
}

/* 设备列表 */
.cast-device-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cast-device-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(51, 51, 51, 0.6);
    border: 1px solid rgba(85, 85, 85, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.cast-device-item:hover {
    background: rgba(0, 120, 212, 0.6);
    border-color: rgba(0, 120, 212, 0.4);
    transform: translateY(-2px);
}

.cast-device-item.selected {
    background: rgba(0, 120, 212, 0.8);
    border-color: rgba(0, 120, 212, 0.6);
    box-shadow: 0 0 12px rgba(0, 120, 212, 0.3);
}

/* 设备图标 */
.cast-device-icon {
    font-size: 24px;
    margin-right: 16px;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* DLNA设备特殊标识 */
.cast-device-item[data-protocol="dlna"] .cast-device-icon::after {
    content: "🔗";
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 10px;
    background: rgba(0, 120, 212, 0.9);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chromecast设备特殊标识 */
.cast-device-item[data-protocol="presentation"] .cast-device-icon::after {
    content: "📡";
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 10px;
    background: rgba(52, 168, 83, 0.9);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 系统投屏设备特殊标识 */
.cast-device-item[data-protocol="system"] .cast-device-icon::after {
    content: "⚙️";
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 10px;
    background: rgba(255, 193, 7, 0.9);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 设备信息 */
.cast-device-info {
    flex: 1;
}

.cast-device-name {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    margin: 0 0 4px 0;
}

.cast-device-type {
    font-size: 13px;
    color: #ccc;
    margin: 0;
}

/* 设备状态 */
.cast-device-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.cast-device-status.busy {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.3);
}

.cast-device-status.offline {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.3);
}

/* 无设备状态 */
.cast-no-devices {
    text-align: center;
    padding: 40px 20px;
}

.cast-no-devices-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.cast-no-devices p {
    color: #ccc;
    font-size: 16px;
    margin: 0 0 20px 0;
}

.cast-tips {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    text-align: left;
}

.cast-tips p {
    color: #ffc107;
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 8px 0;
}

.cast-tips ul {
    margin: 0;
    padding-left: 20px;
    color: #ddd;
    font-size: 13px;
}

.cast-tips li {
    margin-bottom: 4px;
}

/* 刷新按钮 */
.btn-refresh-devices {
    background: rgba(0, 120, 212, 0.8);
    border: 1px solid rgba(0, 120, 212, 0.5);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
}

.btn-refresh-devices:hover {
    background: rgba(0, 120, 212, 0.9);
    transform: translateY(-1px);
}

/* 模态框底部 */
.cast-modal-footer {
    display: flex;
    justify-content: space-between;
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    gap: 12px;
    flex-wrap: wrap;
}

.btn-cancel {
    background: rgba(108, 117, 125, 0.8);
    border: 1px solid rgba(108, 117, 125, 0.5);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: rgba(108, 117, 125, 0.9);
    transform: translateY(-1px);
}

.btn-manual-cast {
    background: rgba(138, 43, 226, 0.8);
    border: 1px solid rgba(138, 43, 226, 0.5);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-manual-cast:hover {
    background: rgba(138, 43, 226, 0.9);
    transform: translateY(-1px);
}

.btn-dlna-diagnose {
    background: rgba(255, 152, 0, 0.8);
    border: 1px solid rgba(255, 152, 0, 0.5);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-dlna-diagnose:hover {
    background: rgba(255, 152, 0, 0.9);
    transform: translateY(-1px);
}

.btn-dlna-diagnose .icon {
    font-size: 16px;
}

.btn-manual-cast:hover {
    background: rgba(138, 43, 226, 0.9);
    transform: translateY(-1px);
}

.btn-connect-device {
    background: rgba(40, 167, 69, 0.8);
    border: 1px solid rgba(40, 167, 69, 0.5);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-left: auto;
}

.btn-connect-device:hover {
    background: rgba(40, 167, 69, 0.9);
    transform: translateY(-1px);
}

.btn-connect-device:disabled {
    background: rgba(108, 117, 125, 0.5);
    border-color: rgba(108, 117, 125, 0.3);
    cursor: not-allowed;
    opacity: 0.6;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .cast-modal-content {
        width: 95%;
        max-height: 80vh;
    }

    .cast-modal-header,
    .cast-modal-body,
    .cast-modal-footer {
        padding: 16px;
    }

    .cast-device-item {
        padding: 12px;
    }

    .cast-device-icon {
        font-size: 20px;
        margin-right: 12px;
        width: 28px;
    }

    .cast-device-name {
        font-size: 15px;
    }

    .cast-device-type {
        font-size: 12px;
    }

    .cast-modal-footer {
        flex-direction: column;
    }

    .btn-cancel,
    .btn-manual-cast,
    .btn-connect-device {
        width: 100%;
        justify-content: center;
    }
}

/* 底部播放控制栏样式 - 参考B站风格 */
.overlay-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
    padding: 8px 0 0 0;
    margin: 0;
}

.playback-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 12px 16px;
    background: transparent;
    margin: 0;
    height: 32px;
    min-height: 32px;
    transition: all 0.3s ease;
}

.playback-left,
.playback-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.playback-left {
    padding-left: 15px;
}

.playback-right {
    padding-right: 15px;
}

.progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.btn-playback,
.btn-episode,
.btn-volume,
.btn-fullscreen {
    background: transparent !important;
    border: none !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    outline: none !important;
    color: #ffffff;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    position: relative;
    overflow: hidden;
}

/* 按钮样式简化 - 移除波纹效果 */

.btn-playback {
    background: transparent !important;
    border: none !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    outline: none !important;
    min-width: 28px;
    height: 28px;
    font-size: 16px;
    padding: 2px;
    /* 确保按钮可以接收点击事件 */
    pointer-events: auto !important;
    cursor: pointer !important;
    /* 防止事件被其他元素阻止 */
    position: relative;
    z-index: 10;
}

.btn-playback:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 4px !important;
    transform: none;
    box-shadow: none;
}

.btn-episode:hover:not(:disabled),
.btn-volume:hover,
.btn-fullscreen:hover {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.btn-episode:disabled {
    background: transparent;
    cursor: not-allowed;
    opacity: 0.4;
}

.btn-episode:disabled:hover {
    background: transparent;
    transform: none;
}

.time-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #ffffff;
    min-width: 80px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    padding: 0 4px;
    height: 24px;
}

.time-separator {
    color: #ccc;
    font-weight: normal;
}

.progress-bar-container {
    flex: 1;
    height: 20px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    pointer-events: auto !important;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: visible !important;
    /* 修复：允许时间预览显示 */
    pointer-events: auto !important;
}

.progress-bar:hover {
    height: 6px;
    background: rgba(255, 255, 255, 0.4);
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #00a1d6;
    border-radius: 2px;
    transition: width 0.1s ease;
}

.progress-handle {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border: 2px solid #00a1d6;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    pointer-events: auto !important;
}

.progress-bar:hover .progress-handle,
.progress-bar.dragging .progress-handle {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* 进度条预览缩略图 */
.progress-preview {
    position: absolute !important;
    bottom: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(0, 0, 0, 0.9) !important;
    color: #fff !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.2s ease !important;
    margin-bottom: 8px !important;
    z-index: 10000 !important;
    display: none !important;
}

/* 显示进度条时间预览 - 最高优先级 */
.progress-bar:hover .progress-preview,
.progress-bar.dragging .progress-preview,
.player-overlay.show .progress-bar:hover .progress-preview,
body .progress-bar:hover .progress-preview,
body .progress-bar.dragging .progress-preview {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    z-index: 99999 !important;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-bar-container {
    width: 60px;
    height: 20px;
    display: flex;
    align-items: center;
}

.volume-bar {
    position: relative;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.volume-bar:hover {
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
}

.volume-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #00a1d6;
    border-radius: 2px;
    transition: width 0.1s ease;
}

.volume-handle {
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border: 2px solid #00a1d6;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.volume-bar:hover .volume-handle,
.volume-bar.dragging .volume-handle {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.0);
}

/* 全屏模式下的底部控制栏样式 */
.player-container:fullscreen .overlay-footer,
.player-container:-webkit-full-screen .overlay-footer,
.player-container:-moz-full-screen .overlay-footer,
body.fullscreen-mode .overlay-footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 999999 !important;
    background: rgba(0, 0, 0, 0.9) !important;
    padding: 20px 30px !important;
    margin: 0 !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

body.fullscreen-mode .playback-controls,
.player-container:fullscreen .playback-controls,
.player-container:-webkit-full-screen .playback-controls,
.player-container:-moz-full-screen .playback-controls {
    gap: 25px !important;
    padding: 20px 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.fullscreen-mode .btn-playback,
body.fullscreen-mode .btn-episode,
body.fullscreen-mode .btn-volume,
body.fullscreen-mode .btn-fullscreen,
.player-container:fullscreen .btn-playback,
.player-container:fullscreen .btn-episode,
.player-container:fullscreen .btn-volume,
.player-container:fullscreen .btn-fullscreen,
.player-container:-webkit-full-screen .btn-playback,
.player-container:-webkit-full-screen .btn-episode,
.player-container:-webkit-full-screen .btn-volume,
.player-container:-webkit-full-screen .btn-fullscreen,
.player-container:-moz-full-screen .btn-playback,
.player-container:-moz-full-screen .btn-episode,
.player-container:-moz-full-screen .btn-volume,
.player-container:-moz-full-screen .btn-fullscreen {
    min-width: 50px !important;
    height: 50px !important;
    font-size: 18px !important;
}

body.fullscreen-mode .btn-playback,
.player-container:fullscreen .btn-playback,
.player-container:-webkit-full-screen .btn-playback,
.player-container:-moz-full-screen .btn-playback {
    min-width: 56px !important;
    height: 56px !important;
    font-size: 20px !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .playback-controls {
        gap: 6px;
        padding: 8px 12px 10px 12px;
        height: 30px;
    }

    .playback-left,
    .playback-right {
        gap: 4px;
    }

    .playback-left {
        padding-left: 8px;
    }

    .playback-right {
        padding-right: 8px;
    }

    .btn-playback,
    .btn-episode,
    .btn-volume,
    .btn-fullscreen {
        min-width: 22px;
        height: 22px;
        font-size: 12px;
        padding: 3px 4px;
    }

    .btn-playback {
        min-width: 26px;
        height: 26px;
        font-size: 14px;
    }

    .time-info {
        min-width: 70px;
        font-size: 10px;
        padding: 0 4px;
        height: 22px;
    }

    .progress-container {
        padding: 0 6px;
    }

    .progress-bar-container {
        padding: 0 6px;
    }

    .volume-control {
        gap: 6px;
    }

    .volume-bar-container {
        width: 50px;
    }
}

@media (max-width: 480px) {
    .playback-controls {
        gap: 4px;
        padding: 6px 10px 8px 10px;
        height: 28px;
    }

    .time-info {
        display: none;
        /* 在很小的屏幕上隐藏时间信息 */
    }

    .volume-bar-container {
        display: none;
        /* 在很小的屏幕上隐藏音量滑块 */
    }

    .volume-control {
        gap: 0;
    }

    .btn-playback {
        min-width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .btn-episode,
    .btn-volume,
    .btn-fullscreen {
        min-width: 20px;
        height: 20px;
        font-size: 10px;
        padding: 2px 3px;
    }
}

.player-container:-webkit-full-screen .btn-fullscreen,
.player-container:-moz-full-screen .btn-playback,
.player-container:-moz-full-screen .btn-volume,
.player-container:-moz-full-screen .btn-fullscreen {
    min-width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
}

/* 测试：按钮样式强制显示 */
.btn-top-control,
.btn-top-control[style],
.btn-top-control[hidden] {
    width: 80px !important;
    height: 40px !important;
    background: yellow !important;
    border: 2px solid red !important;
    border-radius: 6px !important;
    color: black !important;
    font-size: 12px !important;
    cursor: pointer !important;
    display: block !important;
    margin: 2px !important;
    padding: 5px !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
    position: relative !important;
    z-index: 10000 !important;
}

.btn-top-control .icon {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 18px !important;
    /* 增大字体 */
    color: red !important;
    /* 红色字体用于测试 */
    font-weight: bold !important;
}